#ifndef _IMAGE_PULL_PULLFROMRTSP_
#define _IMAGE_PULL_PULLFROMRTSP_

#include "../../../function.h"

namespace sp::Image::Pull{
void register_pullFromRtsp();

/* 
    通过RTSP从服务器拉流
*/
class pullFromRtsp: public Function{
private:
    std::string rtspUrl;      // RTSP URL
    int width;                // 宽度
    int height;               // 高度
    long size;                // 数目
    long index;               // 当前处理到第几帧
    cv::VideoCapture capture; // CV读取指针
public:
    pullFromRtsp(std::vector<std::string> v);
    pullFromRtsp(std::string url, int width, int height, long size);
    pullFromRtsp();
    virtual ~pullFromRtsp();
    static void registe();
    static Function* createObject(std::vector<std::string> params);
    static Function* createObject2();
    virtual void start();
    virtual bool waitForResource();
    virtual void process(std::vector<std::vector<Data*>>& data_input, std::vector<Data*>& data_output);
    virtual bool releaseResource();
    virtual void finish();
    virtual void copy(Function* other);
};

};

#endif